<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
		"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
	<title>robot Custom TreeNode Test</title>

	<style>
		@import "../../../../util/doh/robot/robot.css";
	</style>

	<script type="text/javascript" src="../../../../dojo/dojo.js"></script>

	<script type="text/javascript">
		require([
			"doh/runner", "dojo/robotx",
			"dojo/keys", "dojo/query",
			"dijit/tests/helpers","dojo/domReady!"
		], function(doh, robot, keys, query, helpers){

			var tree,registry;

			robot.initRobot('../test_Custom_TreeNode.html');

			doh.register("_setup", [
				{
					name: "wait for widgets to load",
					timeout: 10000,
					runTest: helpers.waitForLoad
				},
				function setVars(){
					registry = robot.window.require("dijit/registry");
					tree = dojo.global.tree;
				}
			]);

			doh.register("arrow navigation", [
				{
					name: "right arrow, down arrow",
					timeout: 4000,
					runTest: function(){
						var d = new doh.Deferred();

						var firstVisibleNode = query(".dijitTreeLabel", robot.doc)[1];
						firstVisibleNode.focus();

						robot.keyPress(keys.RIGHT_ARROW, 100);
						robot.keyPress(keys.RIGHT_ARROW, 100);
						robot.sequence(d.getTestCallback(function(){
							var focus = dojo.global.dijit.focus.curNode;
							doh.is("Child_0", helpers.innerText(focus), "focused on first child");
						}), 500);

						return d;
					}
				}
			]);

			doh.run();
		});

	</script>
</head>
</html>

